package observer.wechat;

public class Main {

	public static void main(String[] args) {

		WechatPublisher accounts = new WechatPublisher("小旋锋");

		WechatClient user1 = new WechatClient("张三");
		WechatClient user2 = new WechatClient("李四");
		WechatClient user3 = new WechatClient("王五");

		accounts.subscribe(user1);
		accounts.subscribe(user2);
		accounts.subscribe(user3);

		accounts.publish("设计模式 | 观察者模式及典型应用");

		accounts.unsubscribe(user1);
		accounts.publish("设计模式 | 单例模式及典型应用");

	}

}
